package com.me.myFramework.myDI.service;

import com.me.myFramework.myDI.annotation.MyComponent;
import com.me.myFramework.myDI.dao.UserDao;

/**
 * 手写 Spring: service实现类
 *
 * @author ME
 * @date   2019/12/9
 */
@MyComponent("userServiceImpl")
public class UserServiceImpl implements UserService {

    private UserDao dao;

    public UserServiceImpl() {
    }

    public UserServiceImpl(UserDao dao) {
        this.dao = dao;
    }

    @Override
    public void find() {
        System.out.println("service.find()...");
        dao.query();
    }

    public void setDao(UserDao dao) {
        this.dao = dao;
    }
}
